package no.sachmuld.methodcombination.examples.annotation.extendbehaviour.v2;

import no.sachmuld.methodcombination.api.MethodCombinationSupport;
import no.sachmuld.methodcombination.api.MethodInvocation;
import no.sachmuld.methodcombination.api.annotation.Default;
import no.sachmuld.methodcombination.api.annotation.MethodCombinationException;
import no.sachmuld.methodcombination.api.annotation.UsesMethodCombination;

/**
 *
 */
@UsesMethodCombination(FooBehaviour.class)
public class Foo extends MethodCombinationSupport<FooBehaviour> {

    public Foo() {
        with(new FooBehaviour() {

            @Override
            public void foo(MethodInvocation<Void> methodInvocation) {
                System.out.println("Foo.foo");
            }

        });
    }

    @Default
    final public void foo() {
        throw new MethodCombinationException();
    }

    final public Foo with(FooBehaviour... behaviours) {
        super.with(behaviours);
        return this;
    }

}
